﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

using BusinessManagementStudio.Models.BusinessObject.Entities;
using BusinessManagementStudio.Utilities;

namespace BusinessManagementStudio.ViewModel
{
    public class CompanyFMContractor
    {
        public Company company { get; set; }
        public FM fm { get; set; }
        public Contractor contractor { get; set; }
        public IEnumerable<SelectListItem> CurrencyList { get; set; }

        public CompanyFMContractor()
        {
            CurrencyList = GetCurrencyNameList();
        }

        private IEnumerable<SelectListItem> GetCurrencyNameList()
        {
            return GetCurrencyList();
        }

        private List<SelectListItem> GetCurrencyList()
        {
            List<SelectListItem> CurrienciesList = new List<SelectListItem>();

            List<String> AllCurrenciesList = Configuration.CurrencyList;

            foreach (String currency in AllCurrenciesList)
            {
                SelectListItem sListItem = new SelectListItem();
                sListItem.Text = currency;
                sListItem.Value = currency;

                CurrienciesList.Add(sListItem);
            }

            return CurrienciesList;
        }
    }
}